
/**
 * Register controllers here.
*/

module.exports = function(app, passport) {

   app.isLoggedIn = function(req, res, next){
      if(req.isAuthenticated()) return next();
      req.flash('returnUrl', req.url);
      res.redirect('/users/login');
   }

   require('./controllers/home.controller')(app);
   require('./controllers/users.controller')(app, passport);
   require('./controllers/ajax.controller')(app, passport);

}




